package com.example.javafx.simple;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ScrollBar;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

public class ScrollBarExample extends Application {

    @Override
    public void start(Stage primaryStage) {
        // 创建 ScrollBar
        ScrollBar scrollBar = new ScrollBar();
        scrollBar.setMin(0);
        scrollBar.setMax(100);
        scrollBar.setValue(50); // 初始值

        // 创建布局并添加 ScrollBar
        VBox root = new VBox(scrollBar);
        Scene scene = new Scene(root, 300, 100);

        primaryStage.setTitle("ScrollBar Example");
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}